import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljEnterpriseProductForm, XhljEnterpriseProductQuery, XhljEnterpriseProductVo } from '@/api/xhlj/model/enterpriseProductModel';
import { request } from '@/utils/request';

// 查询展商产品列表
export function listEnterpriseProduct(query?: XhljEnterpriseProductQuery) {
  return request.get<TableDataInfo<XhljEnterpriseProductVo>>({
    url: '/xhlj/enterpriseProduct/list',
    params: query,
  });
}

// 查询展商产品详细
export function getEnterpriseProduct(productId: number) {
  return request.get<R<XhljEnterpriseProductVo>>({
    url: `/xhlj/enterpriseProduct/${productId}`,
  });
}

// 新增展商产品
export function addEnterpriseProduct(data: XhljEnterpriseProductForm) {
  return request.post<R<void>>({
    url: '/xhlj/enterpriseProduct',
    data,
  });
}

// 修改展商产品
export function updateEnterpriseProduct(data: XhljEnterpriseProductForm) {
  return request.put<R<void>>({
    url: '/xhlj/enterpriseProduct',
    data,
  });
}

// 删除展商产品
export function delEnterpriseProduct(productIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/enterpriseProduct/${productIds}`,
  });
}
